import 'package:oramemo/generated/json/base/json_convert_content.dart';
import 'package:oramemo/entity/system_language_entity.dart';

SystemLanguageEntity $SystemLanguageEntityFromJson(Map<String, dynamic> json) {
  final SystemLanguageEntity systemLanguageEntity = SystemLanguageEntity();
  final String? msg = jsonConvert.convert<String>(json['msg']);
  if (msg != null) {
    systemLanguageEntity.msg = msg;
  }
  final int? code = jsonConvert.convert<int>(json['code']);
  if (code != null) {
    systemLanguageEntity.code = code;
  }
  final List<SystemLanguageData>? data = (json['data'] as List<dynamic>?)
      ?.map(
          (e) =>
      jsonConvert.convert<SystemLanguageData>(e) as SystemLanguageData)
      .toList();
  if (data != null) {
    systemLanguageEntity.data = data;
  }
  return systemLanguageEntity;
}

Map<String, dynamic> $SystemLanguageEntityToJson(SystemLanguageEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['msg'] = entity.msg;
  data['code'] = entity.code;
  data['data'] = entity.data?.map((v) => v.toJson()).toList();
  return data;
}

extension SystemLanguageEntityExtension on SystemLanguageEntity {
  SystemLanguageEntity copyWith({
    String? msg,
    int? code,
    List<SystemLanguageData>? data,
  }) {
    return SystemLanguageEntity()
      ..msg = msg ?? this.msg
      ..code = code ?? this.code
      ..data = data ?? this.data;
  }
}

SystemLanguageData $SystemLanguageDataFromJson(Map<String, dynamic> json) {
  final SystemLanguageData systemLanguageData = SystemLanguageData();
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    systemLanguageData.createBy = createBy;
  }
  final String? createTime = jsonConvert.convert<String>(json['createTime']);
  if (createTime != null) {
    systemLanguageData.createTime = createTime;
  }
  final String? remark = jsonConvert.convert<String>(json['remark']);
  if (remark != null) {
    systemLanguageData.remark = remark;
  }
  final SystemLanguageDataParams? params = jsonConvert.convert<
      SystemLanguageDataParams>(json['params']);
  if (params != null) {
    systemLanguageData.params = params;
  }
  final int? dictCode = jsonConvert.convert<int>(json['dictCode']);
  if (dictCode != null) {
    systemLanguageData.dictCode = dictCode;
  }
  final int? dictSort = jsonConvert.convert<int>(json['dictSort']);
  if (dictSort != null) {
    systemLanguageData.dictSort = dictSort;
  }
  final String? dictLabel = jsonConvert.convert<String>(json['dictLabel']);
  if (dictLabel != null) {
    systemLanguageData.dictLabel = dictLabel;
  }
  final String? dictValue = jsonConvert.convert<String>(json['dictValue']);
  if (dictValue != null) {
    systemLanguageData.dictValue = dictValue;
  }
  final String? dictType = jsonConvert.convert<String>(json['dictType']);
  if (dictType != null) {
    systemLanguageData.dictType = dictType;
  }
  final String? cssClass = jsonConvert.convert<String>(json['cssClass']);
  if (cssClass != null) {
    systemLanguageData.cssClass = cssClass;
  }
  final String? listClass = jsonConvert.convert<String>(json['listClass']);
  if (listClass != null) {
    systemLanguageData.listClass = listClass;
  }
  final String? isDefault = jsonConvert.convert<String>(json['isDefault']);
  if (isDefault != null) {
    systemLanguageData.isDefault = isDefault;
  }
  final String? status = jsonConvert.convert<String>(json['status']);
  if (status != null) {
    systemLanguageData.status = status;
  }
  final bool? defaultValue = jsonConvert.convert<bool>(json['default']);
  if (defaultValue != null) {
    systemLanguageData.defaultValue = defaultValue;
  }
  return systemLanguageData;
}

Map<String, dynamic> $SystemLanguageDataToJson(SystemLanguageData entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['createBy'] = entity.createBy;
  data['createTime'] = entity.createTime;
  data['remark'] = entity.remark;
  data['params'] = entity.params?.toJson();
  data['dictCode'] = entity.dictCode;
  data['dictSort'] = entity.dictSort;
  data['dictLabel'] = entity.dictLabel;
  data['dictValue'] = entity.dictValue;
  data['dictType'] = entity.dictType;
  data['cssClass'] = entity.cssClass;
  data['listClass'] = entity.listClass;
  data['isDefault'] = entity.isDefault;
  data['status'] = entity.status;
  data['default'] = entity.defaultValue;
  return data;
}

extension SystemLanguageDataExtension on SystemLanguageData {
  SystemLanguageData copyWith({
    String? createBy,
    String? createTime,
    String? remark,
    SystemLanguageDataParams? params,
    int? dictCode,
    int? dictSort,
    String? dictLabel,
    String? dictValue,
    String? dictType,
    String? cssClass,
    String? listClass,
    String? isDefault,
    String? status,
    bool? defaultValue,
  }) {
    return SystemLanguageData()
      ..createBy = createBy ?? this.createBy
      ..createTime = createTime ?? this.createTime
      ..remark = remark ?? this.remark
      ..params = params ?? this.params
      ..dictCode = dictCode ?? this.dictCode
      ..dictSort = dictSort ?? this.dictSort
      ..dictLabel = dictLabel ?? this.dictLabel
      ..dictValue = dictValue ?? this.dictValue
      ..dictType = dictType ?? this.dictType
      ..cssClass = cssClass ?? this.cssClass
      ..listClass = listClass ?? this.listClass
      ..isDefault = isDefault ?? this.isDefault
      ..status = status ?? this.status
      ..defaultValue = defaultValue ?? this.defaultValue;
  }
}

SystemLanguageDataParams $SystemLanguageDataParamsFromJson(
    Map<String, dynamic> json) {
  final SystemLanguageDataParams systemLanguageDataParams = SystemLanguageDataParams();
  return systemLanguageDataParams;
}

Map<String, dynamic> $SystemLanguageDataParamsToJson(
    SystemLanguageDataParams entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  return data;
}

extension SystemLanguageDataParamsExtension on SystemLanguageDataParams {
}